// pages/my/my.js
const WXAPI = require('../main/main');
 const TOOL = require('../../utils/util');
const app = getApp();
Component({

  /**
   * 页面的初始数据
   */
  data: {
    backgroundColor: app.globalData.currentBgColor,//皮肤颜色
    userName:'李学博',
    phone:'18228057066' ,
    deptName:'软件部',
    avatarUrl: "",//用户头像,
  },
  lifetimes: {
    // 组件所在页面的生命周期函数
    attached: function () {
      var that = this;
      var user = app.globalData.user;
      var bgColor = app.globalData.currentBgColor;
      that.getSysUserInfo();
     },
  },
  
  methods: {

    /**
     * 获取用户信息
     */
    getSysUserInfo()
    {
      var that=this;
      wx.getUserInfo({
        success: function (res) {
          that.setData({
            avatarUrl: res.userInfo.avatarUrl,
          })
        }
      })
    },

    /***
     * 用户绑定弹出框
     */
    showAlertModel(){
      this.setData({
        alertModel:'alertModel',
      })
    },
    /****
     * 隐藏弹出框
     */
    hidenModal(e){
      this.setData({
        alertModel:'',
      })
    },
  },
  
})